var commend = {
  typeId: '',
  init: function () {
    this.getData()
    this.render()
  },
  getData: function () {
    var typeid = page.data.cac[3].typeId
    var data = getVodListByTypeId({ TYPEID: typeid })
    page.data.commend = data.data
  },
  render: function () {
    var data = page.data.commend
    var html = ''
    var l = Math.min(data.length, 6)
    for (var i = 0; i < l; i++)  {
      var commend = data[i]
      var id = 'right-' + i
      var img = ''
      var style = ''
      if (i == 0 || i == 1) {
        style = 'top: 0; left:' + (i * (454 + 30)) + 'px;'
        html += '<div id="' + id + '" class="goods-item border-radius item special" style="' + style + '">'
        img = commend.picture[0].picPath92
        html += '<div class="img-container"><img src="' + img + '"/></div>'
        html += '<div class="info-container">'
        html += '<div class="name">' +  commend.name+ '</div>'
        html += '</div></div>'
      } else {
        style = 'top: 310px; left:' + ((i - 2) * (212 + 30)) + 'px;'
        html += '<div id="' + id + '" class="goods-item border-radius item" style="' + style + '">'
        img = commend.picture[0].picPath90
        html += '<div class="img-container"><img src="' + img + '"/></div>'
        html += '<div class="info-container">'
        html += '<div class="name">' +  commend.name+ '</div>'
        html += '<div class="price">兑换：<span class="color">' + commend.price + '熊猫币</span></div>'
        html += '</div></div>'
      }

      // var _html = ''
      // var className = ''
      // if (i == 0 || i == 1) {
      //   className = ' special'
      //   _html += '<img src="' + commend.picture[0].picPath92 + '"/>'
      //   _html += '<div class="right-container">' 
      //   _html += '<div class="right-container-view">'
      //   _html += '<div class="name">' + commend.name + '</div>'
      //   _html += '</div>'
      //   _html += '</div>'
      // } else {
      //   _html += '<img src="' + commend.picture[0].picPath90 + '"/>'
      //   _html += '<div class="name">' + commend.name + '</div>'
      //   _html += '<div class="price">兑换：<span class="color">' + commend.price + '熊猫币</span></div>'
      // }
      // html += '<div id="right-' + i + '" class="goods-item border-radius item ' + className + '">'
      // html += _html
      // html += '</div>'
    }
    $('#right').html(html)
  }
}